gbfile* fcache{nullptr};
gbfile* fexif{nullptr};
QList<ExifIfd> ifds;
-
- ~ExifApp()
- {
- if (fcache) {
- gbfclose(fcache);
- }
- if (fexif) {
- gbfclose(fexif);
- }
- }
};
static gbfile* fin_, *fout_;
-static QList<ExifApp>* exif_apps;
+static QList<ExifApp*>* exif_apps;
static ExifApp* exif_app_;
static const Waypoint* exif_wpt_ref;
static QDateTime exif_time_ref;
static void
exif_release_apps()
{
+ for (auto* app : qAsConst(*exif_apps)) {
+ if (app->fcache) {
+ gbfclose(app->fcache);
+ }
+ if (app->fexif) {
+ gbfclose(app->fexif);
+ }
+ delete app;
+ }
delete exif_apps;
exif_apps = nullptr;
}
exif_app_ = nullptr;
while (! gbfeof(fin_)) {
- exif_apps->append(ExifApp());
- ExifApp* app = &exif_apps->last();
+ exif_apps->append(new ExifApp);
+ ExifApp* app = exif_apps->last();
app->fcache = gbfopen(nullptr, "wb", MYNAME);
app->marker = gbfgetuint16(fin_);
{
gbfputuint16(0xFFD8, fout_);
- for (auto& app_instance : *exif_apps) {
- ExifApp* app = &app_instance;
+ for (auto* app : qAsConst(*exif_apps)) {
gbfputuint16(app->marker, fout_);
exif_rd_init(const QString& fname)
{
fin_ = gbfopen_be(fname, "rb", MYNAME);
- exif_apps = new QList<ExifApp>;
+ exif_apps = new QList<ExifApp*>;
}
static void
exif_success = 0;
exif_fout_name = fname;
- exif_apps = new QList<ExifApp>;
+ exif_apps = new QList<ExifApp*>;
fin_ = gbfopen_be(fname, "rb", MYNAME);
is_fatal(fin_->is_pipe, MYNAME ": Sorry, this format cannot be used with pipes!");